home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 051-075 / scopedisk57 / ipc / ipcports.h < prev   
C/C++ Source or Header  |  1995-03-19  |  4KB  |  86 lines

  1. #ifndef IPC_PORTS_H
  2. #define IPC_PORTS_H
  3.  
  4. /*** include this BEFORE IPC.H (if required) ***/
  5.  
  6. /*******************************************************************
  7.  *                                                                 *
  8.  *                           IPCPorts.h                            *
  9.  *                                                                 *
  10.  *           Inter-Process-Communication Port Format               *
  11.  *                                                                 *
  12.  *              Release  1.0 -- 1988 April 30                      *
  13.  *                                                                 *
  14.  *              Copyright 1988 Peter Goodeve                       *
  15.  *                                                                 *
  16.  *  This source is freely distributable, and may be used freely    *
  17.  *  in any program,  but the structures should not be modified     *
  18.  *  without prior consultation with the author.  (This is just to  *
  19.  *  prevent proliferation of incompatible variants.  Don't be      *
  20.  *  inhibited from suggesting enhancements!)                       *
  21.  *                                                                 *
  22.  *******************************************************************/
  23.  
  24. #ifndef EXEC_TYPES_H
  25. #include "exec/types.h"
  26. #endif
  27.  
  28. #ifndef EXEC_PORTS_H
  29. #include "exec/ports.h"
  30. #endif
  31.  
  32. /*******************************************************************
  33.  *                                                                 *
  34.  *  IPC Ports are essentially standard Exec message Ports except   *
  35.  *  for added fields to keep track of their usage.  Also they      *
  36.  *  are kept on their own list.                                    *
  37.  *                                                                 *
  38.  *  Note that the port name has to be kept WITHIN the structure    *
  39.  *  also, as the process that created it may go away.  The size    *
  40.  *  field holds the size of the structure including the name, so   *
  41.  *  it may be deleted safely when no longer needed.                *
  42.  *                                                                 *
  43.  *******************************************************************/
  44.  
  45. struct IPCPort {
  46.     struct MsgPort  ipp_Port;
  47.     ULONG           ipp_Id;         /* for future use */
  48.     UWORD           ipp_UseCount,   /* number of connections to the port */
  49.                     ipp_Flags,      /* internal information */
  50.                     ipp_Size;       /* size of the WHOLE structure */
  51.     char            ipp_Name[1];    /* where name is actually kept! */
  52.     };
  53.  
  54.  
  55. /* ipp_Flags: */
  56.  
  57. #define IPP_SERVED 0x8000
  58. #define IPP_SHUT 0x4000
  59.  
  60. #define IPP_SERVER_FLAGS 0x00FF
  61. #define IPP_NOTIFY 0x0001
  62.  
  63.  
  64.  
  65. /*******************************************************************
  66.  *                                                                 *
  67.  *  Only one IPCBasePort structure will exist in the system.       *
  68.  *  It is the only IPC Port on the public Exec port list, and      *
  69.  *  has the standard name "IPC_Base_Port".  (Note that the name    *
  70.  *  string begins in the last location of the IPCPort structure;   *
  71.  *  "moreName" is just to provide the necessary space, so the      *
  72.  *  list header begins at a defined offset.)                       *
  73.  *                                                                 *
  74.  *******************************************************************/
  75.  
  76. struct IPCBasePort {
  77.     struct IPCPort ipcb_Port;   /* used to place in public Port list */
  78.                                 /* also will be public port for a Broker */
  79.     char        moreName[20];   /* enough space for name  */
  80.     struct List ipcb_PortList;  /* List of current IPCPorts */
  81.     };
  82.  
  83. /*******************************************************************/
  84.  
  85. #endif
  86.